<%--
    Document   : typeList
    Created on : 2011-4-9, 14:46:26
    Author     : Administrator
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="com.news.bean.*" %>
<%@page import="com.news.dao.*" %>
<%@page import="com.news.servlet.*" %>
<%@page import="com.news.dao.impl.*" %>
<%@page import="java.util.*" %>
<LINK href="images/template.css" type='text/css' rel=stylesheet>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<style type="text/css">
    #d1 {
        float:left;
        background:#f00;
    }
    #d2 {
        float:right;
        background:#0f0;
    }
    #d3 {
        float:right;
        background:#00f;
    }
</style>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body >

        <div>
            <%
            String key = (String) request.getAttribute("key");
            if (key != null && !key.equals("")) {
                List<News> list = (List<News>) request.getAttribute("listbykey");
                if (list != null && list.size() > 0) {
            %>
            <b> <font size="2" color="#336699"> 搜索结果：</font></b><br>
            <%

                    for (News news : list) {
            %>
            <img width="9" height="9" align="absMiddle" src="images/listjt.gif" complete="complete"/>

            <span style="cursor:hand; border-bottom:#336699  solid 1px;" onclick="window.open('display/newstext.jsp?newsid=<%=news.getId()%>')">
                <font size="2" color="#336699"><%=news.getTitle()%></font></span><br>


            <%}
                } else {%>
            对不起，没有您要搜索的新闻。
            <%}
            }%>
        </div>
        <hr></hr>
        <br>

        <%
            List<NewsType> list1 = new NewsTypeDaoImpl().list();
            if (list1 != null && list1.size() > 0) {
                int i = 0;
                for (NewsType newstype : list1) {
                    i++;
                    int sort = newstype.getId();
        %>

        <div  class="individual_boxes">
            <div class="individual_box_one">
                <div class="individual_box_one_picks">
                    <div class="individual_box_one_header">
                        <p> <%=newstype.getName()%> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                         &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                         &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                         &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                         &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                         <span style="cursor:hand;  border-bottom:#336699  solid 1px;"  onclick="window.open('newsSpecial.jsp?newstypeid=<%=newstype.getId()%>')"><font size="1">更多...</font></span></p>

                    </div>
                    <div class="individual_box_one_text">
                        <p>
                            <%
                    List<News> list = new NewsDaoImpl().getBySort(sort);
                    if (list != null && list.size() > 0) {
                        int ii = 0;
                        for (News news : list) {
                            ii++;
                            %>

                            <span style="cursor:hand;  border-bottom:#336699  solid 1px;" onclick="window.open('newstext.jsp?newsid=<%=news.getId()%>')"> <%=news.getTitle()%></span><br>

                            <%
                            if (ii == 6) {  break;
                            }
                        }
                    }%>
                        </p>
                    </div>
                </div>
            </div>
        </div>

        <%
                    if (i % 3 == 0) {
        %>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <%                                                }
                }

        %>


        <%}%>


    </body>
</html>
